/*
 * @Author: xiaosihan 389652405@qq.com
 * @Date: 2025-10-08 05:56:48
 * @LastEditors: xiaosihan 389652405@qq.com
 * @LastEditTime: 2025-10-08 06:40:12
 * @FilePath: \songjiang-warehouse1\srcWeb\views\Home\homeStore.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */


import { makeAutoObservable } from "mobx";
class HomeStore {
    constructor() {
        makeAutoObservable(this, {}, { deep: false });
    }

    //巡检
    inspecting = false;
    // 开始巡检
    setInspect(inspecting: boolean) {
        this.inspecting = inspecting;
    }


    //盘点
    inventory = false;
    // 开始盘点
    setInventory(inventory: boolean) {
        this.inventory = inventory;
    }

    //查档
    check = false;
    // 开始查档
    setCheck(check: boolean) {
        this.check = check;
    }


}


// window.addEventListener("message", (e) => {
//     // 根据消息内容执行相应操作
//     if (e) {
//         switch (e.data) {
//             case "startInspection":
//                 homeStore.setInspect(true);
//                 break;

//             case "endInspection":
//                 homeStore.setInspect(false);
//                 break;

//             case "startInventory":
//                 homeStore.setInventory(true);
//                 break;

//             case "endInventory":
//                 homeStore.setInventory(false);
//                 break;


//             default:
//                 break;
//         }
//     }
// });


const homeStore = new HomeStore();

export default homeStore;